package com.www.applyword.utils;

import android.content.Context;

import com.lljjcoder.Constant;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

/**
 * author : huang
 * date   : 2020/7/30 0030 17:15
 * version: 1.0
 */
public class getJsonUtil {
    public String getJson(Context context, String fileName) {
        StringBuffer stringBuffer = new StringBuffer();
            InputStream is = null;
            try {
                is = context.getAssets().open(fileName);
                BufferedReader bf = new BufferedReader(new InputStreamReader(is,"GBK"));
                String line;
                while ((line = bf.readLine()) != null) {
                    stringBuffer.append(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return stringBuffer.toString();
        }
    }
